﻿using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;

namespace SalaryCom.Cool.App_Start
{
    public class HotJobSeoTitleRouteConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase objHttpContext, Route objRoute, string strSeoHotJobTitleParameterName, RouteValueDictionary objValues, RouteDirection routeDirection)
        {
            if (!objValues.ContainsKey(strSeoHotJobTitleParameterName))
                return false;

            Hashtable hshAllHotJob = (Hashtable)HttpContext.Current.Application["AllHotJobTitle"];
            if (hshAllHotJob.ContainsKey(objValues[strSeoHotJobTitleParameterName].ToString().ToLower()))
                return true;

            return false;
        }
    }
}